@import models.users.NasGroup
@(message: String,groups:Seq[NasGroup])(implicit request: RequestHeader,session:Session)
@import views.html.admin._
@import helper._
@main(message , scripts=scripts) {
<div class="layui-tab layui-tab-brief" lay-filter="accTabBrief" >
    @helper.CSRF.formField
    <ul class="layui-tab-title">
        <li class="layui-this" lay-id="users">用户管理</li>
        <li lay-id="groups">部门管理</li>
        <li lay-id="permission">权限管理</li>
    </ul>
    <div class="layui-tab-content">
        <div class="layui-tab-item layui-show">
            <div class="layui-row layui-col-space2">
                <form class="layui-form" action="">
                    <div class="layui-col-md4">
                        <label class="layui-form-label">用户名</label>
                        <div class="layui-input-block ">
                            <input type="text" name="name" value='' class="layui-input" >
                        </div>
                    </div>
                    <div class="layui-col-md2">
                        <label class="layui-form-label">启用</label>
                        <div class="layui-input-block ">
                            <input type="checkbox" name="active" lay-skin="switch" >
                        </div>
                    </div>

                    <div class="layui-col-md3">
                        <div class="layui-input-block ">
                            <button class="layui-btn" lay-submit lay-filter="formusers">搜索</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>
                </form>
            </div>
            <table id="demoUsers" lay-filter="testusers"></table>
        </div>

        <div class="layui-tab-item">
            <div class="layui-row layui-col-space2">
                <form class="layui-form" action="">
                    <div class="layui-col-md2">
                        <label class="layui-form-label">公司</label>
                        <div class="layui-input-block">
                            <select name="active" lay-verify="required">
                                <option value="0">全部</option>
                                <option value="101">五羊</option>
                                <option value="104">日化</option>
                                <option value="201">礼顿</option>

                            </select>
                        </div>
                    </div>
                    <div class="layui-col-md4">
                        <label class="layui-form-label">部门名</label>
                        <div class="layui-input-block">
                            <input type="text" name="name" placeholder="请输入" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-col-md4">
                        <div class="layui-input-block">
                            <button class="layui-btn" lay-submit lay-filter="formgroups">提交</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>
                </form>
            </div>
            <table id="demoGroups" lay-filter="testgroups"></table>
        </div>

        <div class="layui-tab-item ">
            <div class="layui-row layui-col-space2">
                <form class="layui-form" action="">
                    <div class="layui-col-md4">
                        <label class="layui-form-label">用户名</label>
                        <div class="layui-input-block ">
                            <input type="text" name="name" value='' class="layui-input" >
                        </div>
                    </div>
                    <div class="layui-col-md3">
                        <div class="layui-input-block ">
                            <button class="layui-btn" lay-submit lay-filter="permissionusers">搜索</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>
                </form>
            </div>
            <table id="demoPermission" lay-filter="permissionusers"></table>
        </div>



    </div>
</div>
<script type="text/html" id="userBarDemo">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit" lay-filter="resetpw">重置密码</a>
</script>
<div class="userBarPwdEdit" style="display:none">
    <form class="layui-form" action="" lay-filter="userBarPwdEditForm">
        <div class="layui-form-item">
            <label class="layui-form-label">密码</label>
            <div class="layui-input-inline">
                <input type="password" name="p1" required  lay-verify="required" placeholder="new password" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">确认</label>
            <div class="layui-input-inline">
                <input type="password" name="p2" required lay-verify="required" placeholder="compare password" autocomplete="off" class="layui-input">
            </div>

        </div>
    </form>
</div>
<script type="text/html" id="userBarGroupsDemo">
    <div class="layui-row layui-col-space2">
        <form class="layui-form" action="" lay-filter="jsonSetGroup">

            <div class="layui-col-md3">
                <label class="layui-form-label">NAS组</label>
                <div class="layui-input-block">
                    <select name="gid" lay-verify="required" lay-search>
                        <option value=0>默认组</option>
                        @for(s<-groups){
                        <option value=@s.id>@s.pname</option>
                        }
                    </select>
                </div>
            </div>
        </form>
        <button class="layui-btn" lay-event="changegroup" >设置</button>
    </div>

</script>
}
@scripts = {<script src='@routes.Assets.versioned("js/layui_account.js")' type="text/javascript"></script>}